﻿using System;
using System.ServiceModel;
namespace WebBlueMarble
{
    [ServiceContract(CallbackContract = typeof(ICallback), SessionMode = SessionMode.Required)]
    public interface IService
    {
        [OperationContract(IsInitiating = true, IsOneWay = true, IsTerminating = false)]
        void Start();//세션을 열고 콜백을 등록합니다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void Login(string id);//로긴을 합니다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void InitGame();//초기화를 합니다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void RollDice();//버튼을 조작합니다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void Buy(string title); //땅을 산다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void BuyLodging(string title, Lodging lodging);//숙박시설을 판다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void Sell(string title);//땅을 판다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void SellLodging(string title, Lodging lodging);//숙박시설을 판다.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void Display();//정보를 표시하기 위해 갱신함.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = false)]
        void SendMessage(string message);//채팅할 때 필요함.

        [OperationContract(IsInitiating = false, IsOneWay = true, IsTerminating = true)]
        void Quit();//세션을 닫습니다.
    }
    public interface ICallback
    {
        [OperationContract(IsOneWay = true)]
        void Message(string message);//각종 정보관련 주입

        //여기서 말하는 컨트롤은 클라이언트에 뿌려져 있는 컨트롤임.
        [OperationContract(IsOneWay = true)]
        void ControlEnable(string name, bool enable);//컨트롤 활성화 여부

        [OperationContract(IsOneWay = true)]
        void TimerCount(int count);//시간을 셈

        [OperationContract(IsOneWay = true)]
        void ControlTextChanged(string name, string cotent);//컨트롤에서 문자열 변경

        [OperationContract(IsOneWay = true)]
        void ControlFocus(string name);//컨트롤에 포커스를 줌

        [OperationContract(IsOneWay = true)]
        void CheckChanged(string name, bool enable, bool check);//체크박스를 제어함.

        [OperationContract(IsOneWay = true)]
        void GameBoardOwnerChanged(string areaName, string owner);//땅 주인 표시.

        [OperationContract(IsOneWay = true)]
        void GameBoardPlayerRemove(string areaName, string playername);//화면에서 옮기기전에 지우기.

        [OperationContract(IsOneWay = true)]
        void GameBoardPlayerDisplay(string areaName, string playername);//화면에서 옮기면, 표시하기
    }
}